.class public Lcom/baidu/crabsdk/a/c;
.super Ljava/lang/Object;


# static fields
.field private static ai:Lcom/baidu/crabsdk/a/c;

.field private static aj:Landroid/content/Context;

.field private static ak:Ljava/util/concurrent/ExecutorService;

.field private static al:Z


# instance fields
.field public ag:Lcom/baidu/crabsdk/a/l;

.field public ah:Lcom/baidu/crabsdk/a/p;


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 4

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    sput-object p1, Lcom/baidu/crabsdk/a/c;->aj:Landroid/content/Context;

    new-instance v0, Lcom/baidu/crabsdk/a/p;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-virtual {v1}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;

    move-result-object v1

    sget v2, Lcom/baidu/crabsdk/a/a;->U:I

    int-to-long v2, v2

    invoke-direct {v0, v1, v2, v3}, Lcom/baidu/crabsdk/a/p;-><init>(Ljava/lang/Thread;J)V

    iput-object v0, p0, Lcom/baidu/crabsdk/a/c;->ah:Lcom/baidu/crabsdk/a/p;

    new-instance v0, Lcom/baidu/crabsdk/a/l;

    new-instance v1, Lcom/baidu/crabsdk/a/d;

    invoke-direct {v1, p0}, Lcom/baidu/crabsdk/a/d;-><init>(Lcom/baidu/crabsdk/a/c;)V

    invoke-direct {v0, v1, p1}, Lcom/baidu/crabsdk/a/l;-><init>(Lcom/baidu/crabsdk/a/i;Landroid/content/Context;)V

    iput-object v0, p0, Lcom/baidu/crabsdk/a/c;->ag:Lcom/baidu/crabsdk/a/l;

    sget-object p1, Lcom/baidu/crabsdk/a/c;->ak:Ljava/util/concurrent/ExecutorService;

    if-nez p1, :cond_0

    invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;

    move-result-object p1

    sput-object p1, Lcom/baidu/crabsdk/a/c;->ak:Ljava/util/concurrent/ExecutorService;

    :cond_0
    return-void
.end method

.method static synthetic b(JJJJ)V
    .locals 11

    invoke-static {p0, p1, p2, p3}, Lcom/baidu/crabsdk/a/p;->a(JJ)Ljava/util/ArrayList;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "-BlockCanaryCore- threadStackEntries: size = "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/baidu/crabsdk/c/a;->u(Ljava/lang/String;)I

    invoke-virtual {v0}, Ljava/util/ArrayList;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_0

    invoke-static {}, Lcom/baidu/crabsdk/a/a;->e()Lcom/baidu/crabsdk/a/a;

    move-result-object v2

    iput-object v0, v2, Lcom/baidu/crabsdk/a/a;->ab:Ljava/util/ArrayList;

    move-wide v3, p0

    move-wide v5, p2

    move-wide v7, p4

    move-wide/from16 v9, p6

    invoke-virtual/range {v2 .. v10}, Lcom/baidu/crabsdk/a/a;->a(JJJJ)Lcom/baidu/crabsdk/a/a;

    :cond_0
    return-void
.end method

.method public static c(Landroid/content/Context;)Lcom/baidu/crabsdk/a/c;
    .locals 2

    sget-object v0, Lcom/baidu/crabsdk/a/c;->ai:Lcom/baidu/crabsdk/a/c;

    if-nez v0, :cond_1

    const-class v0, Lcom/baidu/crabsdk/a/c;

    monitor-enter v0

    :try_start_0
    sget-object v1, Lcom/baidu/crabsdk/a/c;->ai:Lcom/baidu/crabsdk/a/c;

    if-nez v1, :cond_0

    new-instance v1, Lcom/baidu/crabsdk/a/c;

    invoke-direct {v1, p0}, Lcom/baidu/crabsdk/a/c;-><init>(Landroid/content/Context;)V

    sput-object v1, Lcom/baidu/crabsdk/a/c;->ai:Lcom/baidu/crabsdk/a/c;

    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception p0

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p0

    :cond_1
    :goto_0
    sget-object p0, Lcom/baidu/crabsdk/a/c;->ai:Lcom/baidu/crabsdk/a/c;

    return-object p0
.end method

.method static synthetic j()Ljava/util/concurrent/ExecutorService;
    .locals 1

    sget-object v0, Lcom/baidu/crabsdk/a/c;->ak:Ljava/util/concurrent/ExecutorService;

    return-object v0
.end method

.method static synthetic k()Landroid/content/Context;
    .locals 1

    sget-object v0, Lcom/baidu/crabsdk/a/c;->aj:Landroid/content/Context;

    return-object v0
.end method

.method public static start()V
    .locals 2

    const/4 v0, 0x1

    sput-boolean v0, Lcom/baidu/crabsdk/a/c;->al:Z

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x10

    if-lt v0, v1, :cond_0

    sget-object v0, Lcom/baidu/crabsdk/a/e;->an:Lcom/baidu/crabsdk/a/e;

    invoke-virtual {v0}, Lcom/baidu/crabsdk/a/e;->start()V

    const-string v0, "start FrameMonitor..."

    invoke-static {v0}, Lcom/baidu/crabsdk/c/a;->s(Ljava/lang/String;)I

    :cond_0
    return-void
.end method

.method public static stop()V
    .locals 2

    const/4 v0, 0x0

    sput-boolean v0, Lcom/baidu/crabsdk/a/c;->al:Z

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x10

    if-lt v0, v1, :cond_0

    sget-object v0, Lcom/baidu/crabsdk/a/e;->an:Lcom/baidu/crabsdk/a/e;

    invoke-virtual {v0}, Lcom/baidu/crabsdk/a/e;->stop()V

    :cond_0
    return-void
.end method
